home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
utils
/
filestuf.lzh
/
FILESTUF.DOC
< prev
next >
Wrap
Text File
|
1990-08-22
|
10KB
|
213 lines
Filestuff v1.0
Copyright (c)1990 by Bill Aycock
Filestuff is an auto program that allows you to copy, rename, or delete
files. Its actions can vary depending on keyboard input, the existence of
a file, or the current screen resolution.
Filestuff is controlled by a script file consisting of standard ASCII
text. Each line of the script must contain a single Filestuff command and
end with a Return character; blank lines are not allowed.
Filestuff's default script (the script that is executed when Filestuff
is run from the AUTO folder) must be named FILESTUF.CMD, and it must be
located in the root directory of your boot drive. Filestuff may also be
used as a .TTP program from the desktop; just pass the name of the script
file you want Filestuff to execute, or no file name at all to run the
default script.
If any errors occur during the execution of a script, you have the option
of seeing an error message on the screen or branching in your script. You
can also totally ignore any errors if you wish.
There are a few example Filestuff scripts in this ARC; take a look at
them to see the sorts of things Filestuff can do. EXAMPLE*.CMD demonstrate
most of the possible commands. DMGRKEYS.CMD shows a simple script that
just displays a few lines of information on the screen. FILESTUF.CMD
demonstrates the Transfer command, and allows you to run the example
script. REAL.CMD is the script that I actually use - it lets me set up a
specific Spectre GCR configuration file depending on which Mac partitions
I want to have available.
***** GENERAL NOTES ON COMMANDS *****
* Blanks or tabs must separate commands and parameters.
* Remember to include the full drive and path specifications unless
you're dealing with files in the default folder.
* Wildcards are acceptable, but only the first file matching the mask
will be affected.
* Only the first letter of each command is significant; you don't need to
spell out the entire command (though you may if you wish).
* Filestuff's COPY command is a one-pass copy routine - you won't be able
to copy a file larger than the copy buffer. Filestuff grabs all
available RAM for its buffer, so this shouldn't cause a problem unless
you try to copy a very large file. (See the ? command below.)
* Unless you have a reason to do otherwise, you may want to include a
BUFFER command at the end of your script. This will clear the key buffer
before Filestuff ends, so extra keypresses won't interfere with the next
program to run. (But see DMGRKEYS.CMD for one example of a script where
you _wouldn't_ want to clear the key buffer.)
***** COMMAND LIST *****
? - Displays work area size in hex. The work area contains both the script
and the copy buffer. The largest file Filestuff can copy will be this
size minus the size of the current script. (Filestuff requires at least
a 2K work area, and also reserves 2K for the system.)
; - A comment. Comments can also be added to the end of any command line.
QUIT - Stop processing and exit.
COPY file1 file2 - Read file1 into memory, then create and write file2.
DELETE file - Delete a file.
RENAME oldname newname - Rename a file. Note: if a file with the new name
already exists, you'll get an error!
ECHO - Controls the file-command echo. When it's on, the copy, delete,
rename and transfer command lines are displayed. Follow the ECHO
command with a + to turn the echo on, or a - to turn the echo off. If
neither a + nor a - follows the command, echo status is toggled.
SHOW text - Displays text on screen. The text includes everything from
the first character after the SHOW command through the Return at the end
of the line. If you want to get fancy, you can embed standard VT-52
control codes in your text - for example, include an ESCAPE-E in your
text to clear the screen and home the cursor. (The Flash edit buffer is
a good editor to use for preparing SHOW commands, since it displays the
ESC and other control characters.)
VIDEO - Inverse video toggle - prints SHOW text white on black. As for
the ECHO command, follow this with a + to turn on inverse video, a - to
restore normal video, or neither to toggle inverse video on or off.
WAIT n - Waits n seconds unconditionally. (0<=n<=255)
PAUSE n - Waits n seconds, but ends waiting if a key is pressed.
(0<=n<=255)
TRANSFER filename - Transfers control to a different script file. If
the specified file does not exist, this command is ignored.
@ n - A label. Labels must be numbers between 1 and 255 (e.g., "@ 9"
or "@ 255"). They don't need to be defined in numerical order. All
labels are interpreted before any commands are executed, so only the
LAST occurrence of a label counts. A jump to an undefined label is
ignored. Remember to include the space between the @ symbol and the
label number!
JUMP label - An unconditional branch; jumps to the specified label.
Note: DO NOT include the "@" symbol in ANY jump commands!
Z label - Jumps to label if the most recent copy, rename, or delete
operation caused an error. Note that this command does NOT set up an
automatic error routine - you need to explicitly check for errors with
the Z command! There is also a second form of this command -- if you
use a Z command with NOTHING ELSE on the command line (just a lone "Z"),
Filestuff will display an error message explaining what happened. If you
wish, you can use both forms of the command - a lone Z to show an error
message, then a Z LABEL to jump to a recovery routine. (Yeah, I know, Z
isn't a very good mnemonic...)
FEXISTS filespec label - Jumps to label if the specified file exists.
HIREZ label - Jumps to label if you're in high rez (monochrome).
LOWREZ label - Jumps to label if you're in low rez. One caution here: if
you use a program like Desk Manager to switch from low to medium
resolution _after_ Filestuff has run, you can end up in medium rez even
though your LOWREZ jump worked (since you were actually in low rez when
Filestuff ran). Be aware of this possibility if you need to set up some
file commands that depend on low or medium resolution.
MEDREZ label - Jumps to label if you're in medium rez.
KEYGET - Gets a keypress IF ONE IS WAITING. Note that this command WON'T
wait around for a key to be pressed! You'll normally use the PAUSE
command right before a KEYGET.
BUFFER - Clears the keypress buffer. Use this command before asking for
keyboard input to make sure you don't read an "old" keypress.
IFKEY value label - Jumps to label if the keypress from a KEYGET
matches the specified value. "Value" can be a letter or a digit, or a
special value indicated by a slash:
"//" matches the slash character
"/1" to "/0" match function keys f1-f10 (note, "/0"=f10)
also note, shift is ignored for the function keys!
"/help" matches the HELP key
"/return" matches both the RETURN and ENTER keys
"/space" matches the SPACE character
"/undo" matches the UNDO key
"/any" matches _any_ keypress
"/none" means NO KEYPRESS IS WAITING (no key was pressed)
As with commands, only the first character after the slash is important.
No special provision is made for shift, control, or alternate keys;
except for the special keys above, you can only check for standard ASCII
characters. A test for an undefined special key (i.e., slash followed by
some character not listed above) is treated like a test for a slash.
***** CREDITS *****
Filestuff was written in 100% assembly language using the DevpacST
assembler. The string routines used are from a library written in
conjunction with Robert Birmingham. The latest version of Filestuff can
always be found on Compuserve's Atari Productivity Forum (GO ATARIPRO at
any ! prompt). If you have any questions, comments, or suggestions, the
fastest way to get a response is to leave me a mes